package com.litchi.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import cn.bmob.v3.BmobUser;

import com.litchi.R;
import com.litchi.bean.UserBean;
import com.litchi.utils.Constants;

public class PurseActivity extends Activity implements OnClickListener {

	private TextView balanceText,pointText;
	private String userKey;
	UserBean mBean1;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_purse);
		findViewById(R.id.img_back).setOnClickListener(this);
		balanceText=(TextView)findViewById(R.id.text_balance);
		pointText=(TextView)findViewById(R.id.text_point);
		userKey = getIntent().getStringExtra(Constants.USER_KEY);
	  
	}
	@Override
	protected void onResume() {
		super.onResume();
		 mBean1=BmobUser.getCurrentUser(this,UserBean.class);
		  balanceText.setText(mBean1.getBalance().toString());
			pointText.setText(mBean1.getPoints().toString());
		 
	}
	
	 
	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.img_back:
			finish();
			break;

		default:
			break;
		}
	}

}
